import requests
import json


headers = {
    "accept": "application/json, text/plain, */*",
    "accept-language": "zh-CN,zh;q=0.9",
    "content-type": "application/json",
    "origin": "https://ad.xiaohongshu.com",
    "priority": "u=1, i",
    "referer": "https://ad.xiaohongshu.com/aurora/ad/manage/campaign?vSellerId=67dbb840108b4d0015a72115",
    "sec-ch-ua": "\"Not)A;Brand\";v=\"8\", \"Chromium\";v=\"138\", \"Google Chrome\";v=\"138\"",
    "sec-ch-ua-mobile": "?0",
    "sec-ch-ua-platform": "\"Windows\"",
    "sec-fetch-dest": "empty",
    "sec-fetch-mode": "cors",
    "sec-fetch-site": "same-origin",
    "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36",
    "v-seller-id": "67dbb840108b4d0015a72115",
    "x-b3-traceid": "00f8a7cdac3b66db",
    "x-s": "slvWsYZUZ6FpZBq6OjTCOlMpOi1C1BvLZ2TGOjqU0jF3",
    "x-s-common": "2UQAPsHC+aIjqArjwjHjNsQhPsHCH0rjNsQhPaHCH0c1PahFHjIj2eHjwjQgynEDJ74AHjIj2ePjwjQY4gQ6qfrTq9YSJBIjNsQh+sHCH0H1Pshl+AWjNsQh+aHCH0rE+0mSPfb08nGF8gGIP0mY8BQlGf4h8B+IqAWhqBYj4nTCGnQ1Gnkf+/ZIPeZU+AHUweZjNsQh+jHCHjHVHdW7H0ijHjIj2eWjwjQQPAYUaBzdq9k6qB4Q4fpA8b878FSet9RQzLlTcSiM8/+n4MYP8F8LagY/P9Ql4FpUzfpS2BcI8nT1GFbC/L88JdbFyrSiafp/JDMra7pFLDDAa7+8J7QgabmFz7Qjp0mcwp4fanD68p40+fp8qgzELLbILrDA+9p3JpH9LLI3+LSk+d+DJfpSL98lnLYl49IUqgcMc0mrcDShtMmozBD6qM8FyFSh8o+h4g4U+obFyLSi4nbQz/+SPFlnPrDApSzQcA4SPopFJeQmzBMA/o8Szb+NqM+c4ApQzg8Ayp8F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+7Ql4rRQ4dpnagGhpFSewozUpdqEanTHJLSe4d+/qgq9GfMjPLSizAzQ4jRAy9G7q7YM4FpQ4SrAaLpBqf48Lb8Q4fH92jRB+rSe/7+nJDESPop7arSiP7+hqgchanYQ+rS989prqg4Uag8j87Ql4FpQcURSPMSlJURn4ebOLozCaLPI8n8l4FRQyBpAngQjyDSe+7+hLApAnp8F/o4mPBpgqgq6Jp4DqAbM4oQQP9zAprDM8gYM4rlQzgbLanSVJg+c4A+wG7m7a/P98n8n47SAn04SypkVPoQl4rRQ2BMSagYdq98Vt9pQPFESzopFzDSeqSmQyrbSpfQz4DSbqnRQyLIUaBQgOaHVHdWEH0ilw/HlP/cI+Aq9NsQhP/Zjw0ZVHdWlPaHCHflk4BLjKc==",
    "x-t": "1753065771401"
}
cookies = {
    "a1": "1960e2acef4ev020adbqbgxdcps88phbukzabnajf50000272280",
    "webId": "4b6833e542f84e76fbfb34e006eddce8",
    "gid": "yjK8dJ0fS47WyjK8dJ0SdTI0i4dh8J80fDADuVikCfSUM028YYUxDD888JWJJY88jy8DJjDy",
    "customerClientId": "279177063808841",
    "abRequestId": "4b6833e542f84e76fbfb34e006eddce8",
    "x-user-id-fankui-out.xiaohongshu.com": "616fdd2b85d0b300016960dc",
    "x-user-id-partner.xiaohongshu.com": "616fdd2b85d0b300016960dc",
    "x-user-id-ad-market.xiaohongshu.com": "616fdd2b85d0b300016960dc",
    "access-token-ad-market.xiaohongshu.com": "customer.ad_market.AT-68c517519459434552924512enefn093ihp1uxmh",
    "web_session": "040069b47b667a0c594b13eb563a4bf1a8fe62",
    "unread": "{%22ub%22:%22684949860000000022029f18%22%2C%22ue%22:%226855fee2000000002203c98c%22%2C%22uc%22:24}",
    "x-user-id-pgy.xiaohongshu.com": "64faeddd7500000000000010",
    "webBuild": "4.72.0",
    "access-token-chengfeng.xiaohongshu.com": "customer.ad_wind.AT-68c517527479173581502636x7vs9lqjn1q5taio",
    "acw_tc": "0a42136b17530653232416552e273153ff70ee67d0ef8f0061f080f95fd2ce",
    "customer-sso-sid": "68c5175293583034733189567il82dr13yitxixg",
    "ads-partner-sid": "0fa91a445a6242f998f7f1c525ffd654",
    "system.alias": "ads_partner",
    "access-token-partner.xiaohongshu.com": "customer.ads_partner.AT-68c517529358303378212305jli6z3linmiy262z",
    "xsecappid": "aurora-shell",
    "access-token-ad.xiaohongshu.com": "customer.leona.AT-68c517529358384982143868hdbslmgatbmoauts",
    "ares.beaker.session.id": "1753065372754066192318",
    "loadts": "1753065411625",
    "websectiga": "984412fef754c018e472127b8effd174be8a5d51061c991aadd200c69a2801d6",
    "sec_poison_id": "a38aba98-1821-41c9-a1a6-e9fbf7b22693"
}
url = "https://ad.xiaohongshu.com/api/leona/rtb/account/budget"
data = {
    "type": 0,
    "limitDayBudget": 1,
    "budget": 220000,
    "smartSwitch": 0
}
data = json.dumps(data, separators=(',', ':'))
response = requests.put(url, headers=headers, cookies=cookies, data=data)

print(response.text)
print(response)